package com.mingqijia.gassafety.shared.constant;
//规则类型：0设备故障 1设备离线 2设备运行报告 3服务到期提醒
public enum StrategyTypeEnum {
    DEVICE_BROKEN(0, "设备故障"),
    DEVICE_OFFLINE(1, "设备离线"),
    DEVICE_RUNNING(2, "设备运行报告"),
    DEVICE_EXPIRATION(3, "服务到期提醒"),
    OTHER(4, "其他");

    StrategyTypeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private static final StrategyTypeEnum[] VALUES = StrategyTypeEnum.values();

    public static StrategyTypeEnum matcher(int value) {
        for (StrategyTypeEnum ele : VALUES) {
            if (ele.code == value) {
                return ele;
            }
        }
        return StrategyTypeEnum.OTHER;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    private Integer code;
    private String msg;

}

